package com.example.common.utils;

import lombok.Getter;

@Getter
public enum ResultCodeEnum {

    SUCCESS(true, 200, "成功"),
    UNKNOWN_REASON(false, 201, "未知错误"),
    BAD_SQL_GRAMMAR(false, 211, "sql语法错误"),
    JSON_PARSE_ERROR(false, 212, "json解析异常"),
    PARAM_ERROR(false, 213, "参数不正确"),
    FILE_UPLOAD_ERROR(false, 214, "文件上传错误"),
    EXCEL_DATA_IMPORT_ERROR(false, 215, "Excel数据导入错误"),

    LOGINSUCCESS(true, 200, "登录成功"),
    LOGINERROR(false, 210, "用户名或密码错误"),
    ACCESSERROR(false, 211, "权限不足"),
    REMOTEERROR(false, 212, "远程调用失败"),
    REPERROR(false, 213, "重复操作"),
    DATAERROR(false, 214, "数据异常"),
    BUSINESS_ERROR(false, 215, "业务错误"),
    SERVER_ERROR(false, 500, "系统错误"),

    REGISTERSUCCESS(true, 200, "注册成功"),
    REGISTERERROR(false, 216, "用户已存在，请重新注册！")
    ;


    private boolean success;
    private Integer code;
    private String message;
    private Object data;


    private ResultCodeEnum(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

}
